package com.shanshui.fragmentback;

import android.app.AppComponentFactory;

import androidx.appcompat.app.AppCompatActivity;

/**
 * @author mashanshui
 * @date 2021/12/24
 * @desc TODO
 */
public class BaseActivity extends AppCompatActivity implements OnBackPressedDispatcherOwnerV2{
    private OnBackPressedDispatcherV2 onBackPressedDispatcherV2 = new OnBackPressedDispatcherV2(new Runnable() {
        @Override
        public void run() {
            BaseActivity.super.onBackPressed();
        }
    });

    @Override
    public void onBackPressed() {
        onBackPressedDispatcherV2.onBackPressed();
    }

    @Override
    public OnBackPressedDispatcherV2 getBackPressedDispatcher() {
        return onBackPressedDispatcherV2;
    }
}
